﻿<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>生产任务单完成情况明细表</title>
    <link href="../../Scripts/jquery-easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
    <script src="../../Scripts/jquery-easyui/jquery.min.js"></script>
    <script src="../../Scripts/jquery-easyui/jquery.easyui.min.js"></script>
    <script src="../../Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js"></script>
    <link href="../../Content/themes/icon.css" rel="stylesheet" />
    <link href="../../Content/themes/table.css" rel="stylesheet" />
    <link href="../../Content/formstyles.css" rel="stylesheet" />
    <script src="../../Content/js/common.js?v=12"></script>
   
</head>
<body>
    <div id="ui_main_layout" class="easyui-layout" data-options="fit:true,border:false">
        <div data-options="region:'north',split:true,border:true,collapsed:false" title="条件搜索" style="height:104px;">
            <div id="ui_main_search">
                <div>
                    <input type="text" class="easyui-textbox" id="FBillNo" data-options="width:200, label:'订单号',labelPosition:'before',labelWidth:50,labelAlign:'right',readonly:false" />
                    <input type="text" class="easyui-textbox" id="ItemName" data-options="width:200, label:'产品名称',labelPosition:'before',labelWidth:50,labelAlign:'right',readonly:false" />
                    <input type="text" class="easyui-textbox" id="FModel" data-options="width:200, label:'图号',labelPosition:'before',labelWidth:50,labelAlign:'right',readonly:false" />
                </div>
                <div>
                     <input class="easyui-combobox" id="Dept" name="Dept" data-options="
                           editable:false,
                           width:200,
                           label:'部门：',
                           labelPosition:'before',labelWidth:80,labelAlign:'right',
                           required:true, valueField: 'DepartmentName', textField: 'DepartmentName',url: '/Common/SelectDepartment' ">
                    
                    <input class="easyui-combobox" id="period" name="period" data-options="editable:false, width:200,
                                    label:'查询期间：',labelPosition:'before',labelAlign:'right',value:'全部',
                               valueField: 'InfoName', textField: 'InfoName',url: '/Common/SelectBasicInfo?p=815' ">
                <!--</div>
                <div>--> 
                <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" plain="true"
   onclick="ui_main_searchdata();">生成报表</a>
                    <a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-search" plain="true"
                       onclick="ui_main_exportdata();">导出报表</a>
            </div>
        </div>     
    </div>
        <div data-options="region:'center',border:false">
    <table id="dg_main" data-options="fit:true,border:false"></table>
</div>
    <script type="text/javascript">
        // @"select  a.FBillNo,a.FQty jhsl,a.FWorkTypeID ddlx,b.FQty rksl,c.FDate rksj,
        //e.FAdviceConsignDate jhsj,a.fcommitdate xdsj,a.ffinishdate wgsj,
        //a.FPlanFinishDate jhwgsj,a.FItemID,FHeadSelfJ0181 dept,f.FName,f.FModel,g.FCreateDate tzsj,checkDate,计划完工时间
        var columns_main = [[
					{ width: 80, title: '订单号', field: 'FBillNo', align: 'right', sortable: false },
                    { width: 100, title: '产品名称', field: 'FName', align: 'center', sortable: false },
                    { width: 100, title: '图号', field: 'FModel', align: 'center', hidden: false },
                          { width: 100, title: '部门', field: 'dept', align: 'center', },
						   { width: 100, title: '计划数量', field: 'jhsl', align: 'center', },
                           { width: 100, title: '按计划时间完成数量', field: 'rksl', align: 'center', },
                           { width: 100, title: '已完成数量', field: 'rksl', align: 'center', },
                            {
                                width: 100, title: '订单类别', field: 'ddlx', align: 'center',formatter:function(a,b,c){
                                    var x;
                                    switch (a) { 
                                        case 68:
                                            x = "加急订单";
                                            break;
                                        case 55:
                                            x = "普通订单";
                                            break;
                                        case 57:
                                            x = "备件计划";
                                            break;
                                        case 1004:
                                            x = "研发项目";
                                            break;
                                        case 1002:
                                            x = "维修";
                                            break;
                                        default:
                                            x=a;
                                            break; 
                                    }
                                    return x; 
                                }
                            },
                             { width: 100, title: '订单计划下达时间', field: 'xdsj', align: 'center', },
                              { width: 100, title: '事业部图纸下达时间', field: 'tzsj', align: 'center', },
                                { width: 100, title: '订单计划完成时间', field: 'checkDate', align: 'center', },
                                  { width: 100, title: '实际完成时间', field: 'wgsj', align: 'center', },
							 {
							     width: 100, title: '按计划兑现率', field: 'khjhdxl', align: 'center', formatter: getPercent
							 },
							  { width: 100, title: '兑现率', field: 'dxl', align: 'center', formatter: getPercent },

        ]];

        $(function () {
            ui_main_searchdata();

        });

        function ui_main_searchdata() {

            $("#dg_main").datagrid({       //初始化datagrid
                url: "/Rpt/GetRptPageCommon?&r=" + Math.random(),
                title: "生产计划兑现率明细表", 
                fitcolumns: true,
                striped: true,
                rownumbers: true,
                pagination: true,
                pageSize: 20,
                singleSelect: true,
                queryParams: {
                    "RptName": "finishRateDetail",
                    "Dept": $("#Dept").val(),
                    "ItemName": $("#ItemName").val(),
                    "FBillNo": $("#FBillNo").val(),
                    "FModel": $("#FModel").val(),
                    "period": $("#period").val(),
                    "year": 2019,
                },
                idField: 'id',
                sort: 'FBillNo',
                order: 'asc',
                pageList: [20, 40, 60, 80, 100],
                frozenColumns: [[]], 
                //toolbar: toolbar.length == 0 ? null : toolbar,  
                columns: columns_main,

                // onLoadSuccess: function (data) {  }
            });
       }
        function ui_main_exportdata() {
            $.show_alert("消息", "功能待发布！");
            //$.show_warning("消息","功能待发布！")
           //$('#ui_main_search input').val('');
           //$('#ui_main_search select').val('select'); 
       }

        </Script>
</div>    
</body>
    </html>
